<template>
  <div class="ly">
    <el-container>
      <el-aside width="200px">
        <h5>小U后台管理</h5>
        <el-col :span="12">
          <el-menu
            router
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-menu-item index="/layout">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>首页</span>
              </template>
            </el-menu-item>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>系统设置</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/layout/menu">菜单管理</el-menu-item>
                <el-menu-item index="/layout/role">角色管理</el-menu-item>
                <el-menu-item index="/layout/admin">管理员管理</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>商城管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/layout/cate">商品分类</el-menu-item>
                <el-menu-item index="1-2">商品规格</el-menu-item>
                <el-menu-item index="/layout/goods">商品管理</el-menu-item>
                <el-menu-item index="1-4">会员管理</el-menu-item>
                <el-menu-item index="1-5">轮播图管理</el-menu-item>
                <el-menu-item index="1-6">商品秒杀</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-col>
      </el-aside>
      <!-- 右侧 -->
      <el-container>
        <el-header>Header</el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>
<style >
* {
  margin: 0px;
  padding: 0px;
}
.ly h5 {
  line-height: 60px;
}
.ly .el-header,
.ly .el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.ly .el-menu-vertical-demo {
  width: 199px;
  text-align: left;
  overflow: hidden;
}
.ly .el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.ly .el-main { 
  background-color: #e9eef3;
  color: #333;
  height: 90vh;
}

.ly body > .el-container {
  margin-bottom: 40px;
}

.ly .el-container:nth-child(5) .el-aside,
.ly .el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.ly .el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>